<html>
<head><meta charset="utf-8"><title>rust-analyzer sync · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html">rust-analyzer sync</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="174558015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174558015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174558015">(Aug 30 2019 at 16:02)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="129457">@Florian Diebold</span> -- are you around for me to ask questions of?</p>



<a name="174558046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174558046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174558046">(Aug 30 2019 at 16:03)</a>:</h4>
<p>To start, you posed these numbers in another topic:</p>
<blockquote>
<p>Well, it seems like it might. Here are numbers for analyzing the Chalk repo:<br>
Everything enumerable, using fuel: 20.685380613s<br>
Everything enumerable, without fuel: 20.752197389s<br>
Everything enumerable, removing our hardcoded blacklist of 'bad' traits (Send, Sync, Sized, the Fn traits): seems to hang indefinitely<br>
Marking those traits as non-enumerable instead: 21.311616989s</p>
</blockquote>
<p>where did they come from and how did you get them?</p>



<a name="174558397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174558397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174558397">(Aug 30 2019 at 16:07)</a>:</h4>
<p>yes</p>



<a name="174558468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174558468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174558468">(Aug 30 2019 at 16:08)</a>:</h4>
<p>I just ran ra_cli's <code>analysis-stats</code> command by hand, nothing scientific ;)</p>



<a name="174558521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174558521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174558521">(Aug 30 2019 at 16:09)</a>:</h4>
<p>(we've run into new cases where trait solving takes a long time since then though: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/1684" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/1684">https://github.com/rust-analyzer/rust-analyzer/issues/1684</a>)</p>



<a name="174558536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174558536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174558536">(Aug 30 2019 at 16:09)</a>:</h4>
<p>Do you have some open issues or other things with steps to reproduce really painful slowdowns?</p>



<a name="174558559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174558559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174558559">(Aug 30 2019 at 16:09)</a>:</h4>
<p>I guess that's an example :)</p>



<a name="174559089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174559089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174559089">(Aug 30 2019 at 16:14)</a>:</h4>
<p>Though I was hoping for something a bit more .. "reduced"</p>



<a name="174559203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174559203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174559203">(Aug 30 2019 at 16:15)</a>:</h4>
<p>Yeah, I haven't looked into that case in detail either so far</p>



<a name="174560444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174560444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174560444">(Aug 30 2019 at 16:30)</a>:</h4>
<p>I could do that later today and try to create a small example if you think it'll help though ;)</p>



<a name="174560953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174560953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174560953">(Aug 30 2019 at 16:36)</a>:</h4>
<p>I think this hurts a lot lately: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/1684#issuecomment-526589665" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/1684#issuecomment-526589665">https://github.com/rust-analyzer/rust-analyzer/issues/1684#issuecomment-526589665</a></p>



<a name="174561013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174561013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174561013">(Aug 30 2019 at 16:37)</a>:</h4>
<p>I think that's mainly because we're using Chalk in more cases though</p>



<a name="174564348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174564348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174564348">(Aug 30 2019 at 17:16)</a>:</h4>
<p>OK, so, I've been reading into the code. I've been collecting some notes in <a href="https://paper.dropbox.com/doc/Chalk-2019-08-30-notes--Aj0kSd2UK0M_JpT~fCqNhNq9Ag-uoYGdXeqT26rvIsLtHxUV" target="_blank" title="https://paper.dropbox.com/doc/Chalk-2019-08-30-notes--Aj0kSd2UK0M_JpT~fCqNhNq9Ag-uoYGdXeqT26rvIsLtHxUV">this paper document</a>, though they're more notes to myself.</p>



<a name="174564363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174564363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174564363">(Aug 30 2019 at 17:16)</a>:</h4>
<p>I think that the integration of normalization into rust-analyzer doesn't quite look like the "lazy normalization" design we are shooting for in rusc.</p>



<a name="174564389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174564389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174564389">(Aug 30 2019 at 17:16)</a>:</h4>
<p>I also think I see a good sol'n to the fuel problem</p>



<a name="174564431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174564431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174564431">(Aug 30 2019 at 17:17)</a>:</h4>
<p>hmm, that may not be entirely true</p>



<a name="174564507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174564507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174564507">(Aug 30 2019 at 17:18)</a>:</h4>
<p>in any case I was thinking that, with some relatively minimal tweaks, we can modify how chalk's solver works so that it doesn't have as many "loops" -- in particular, handling of cyclic impls today potentially requires iterating over <em>all</em> impls</p>



<a name="174564543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174564543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174564543">(Aug 30 2019 at 17:19)</a>:</h4>
<p>I think my ideal would be that fuel is more-or-less moved out from chalk and I think we could move closer to that -- though I realize that it's possible that even processing one strand might require a lot of <em>recursion</em></p>



<a name="174564588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174564588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174564588">(Aug 30 2019 at 17:19)</a>:</h4>
<p>that said, the other thing I remember now that I want to investigate is that I want to look at the "other side" of how the integration with rust-analyzer is working -- i.e., the data that chalk pulls from r-a about what traits/impls exists. I sort of remember thinking that we needed to improve that setup, and I've kind of forgotten where it stands now.</p>



<a name="174565271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174565271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174565271">(Aug 30 2019 at 17:27)</a>:</h4>
<p>I was meaning to ask about lazy normalization, since I couldn't find any explanation of it -- my impression was that it means normalization happens during unification (resulting in additional obligations), but I'm not very clear on what practical difference that makes</p>



<a name="174565458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174565458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174565458">(Aug 30 2019 at 17:29)</a>:</h4>
<p>Concerning fuel, I did try a bit to reorganize the chalk solver loop so we could handle it from the outside, but it wasn't so easy because after getting the first solution, the loop has to run a bit further to determine whether the answer is ambiguous</p>



<a name="174565749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174565749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174565749">(Aug 30 2019 at 17:32)</a>:</h4>
<p>yes. that will still be needed. the main thing we can do is move those invocations a bit out so they can be interrupted if you no longer care</p>



<a name="174565845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174565845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174565845">(Aug 30 2019 at 17:33)</a>:</h4>
<p>Btw <span class="user-mention" data-user-id="116009">@nikomatsakis</span> did you see the issue I opened in the chalk repo? It outlines two other problems I ran into with associated types that I could use feedback on. Maybe they're related to the lazy normalization thing</p>



<a name="174567129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174567129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174567129">(Aug 30 2019 at 17:48)</a>:</h4>
<p><span class="user-mention" data-user-id="129457">@Florian Diebold</span> nope, I'll check out now</p>



<a name="174567136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/rust-analyzer%20sync/near/174567136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/rust-analyzer.20sync.html#174567136">(Aug 30 2019 at 17:48)</a>:</h4>
<p>to a 1st approx you can assume I see no github notifications :P</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>